<%--
    Created by panzhuowen on 2015/2/7.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!-- BEGIN HEADER -->
<div class="pre-header">
    <div class="container">
        <div class="row">
            <%--<!-- BEGIN TOP BAR LEFT PART -->--%>
            <div class="col-md-6 col-sm-6 additional-shop-info">
            <ul class="list-unstyled list-inline">
                <li><i class="fa fa-desktop"></i><span>比特能.专家机器人</span></li>
                <li><i class="fa fa-envelope-o"></i><span>www.ccut.edu.cn</span></li>
            </ul>
            </div>
            <%--<!-- END TOP BAR LEFT PART -->--%>
            <!-- BEGIN TOP BAR MENU -->
            <c:if test="${User.username == null}">
                <div class="col-md-6 col-sm-6 additional-nav pull-right">
                    <ul class="list-unstyled list-inline pull-right">
                        <li><a href="login">登录</a></li>
                        <li><a href="registration">注册</a></li>
                    </ul>
                </div>
            </c:if>
            <c:if test="${User.username != null}">
                <div class="col-md-6 col-sm-6 additional-nav pull-right">
                    <ul class="list-unstyled list-inline pull-right">
                        <li class="dropdown dropdown-extended dropdown-notification" id="header_home_bar">
                            <a href="#" title="首页" onclick="toHome()" class="dropdown-toggle" data-toggle="dropdown"
                               data-hover="dropdown"
                               data-close-others="true">
                                <i class="fa fa-home"></i>
                            </a>
                            <ul></ul>
                        </li>

                        <!-- BEGIN USER LOGIN DROPDOWN -->
                        <li class="dropdown dropdown-user">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown"
                               data-close-others="true">
                                <span id="userNameTop" class="username">${User.username}</span>
                                <i class="fa fa-angle-down"></i>
                            </a>
                            <ul class="dropdown-menu">
                                <li>
                                    <a href="#" onclick="selfCenter()">
                                        <i class="fa fa-key"></i> 个人中心
                                    </a>
                                </li>
                                <li>
                                    <a href="#" onclick="logout()">
                                        <i class="fa fa-key"></i> 退 出
                                    </a>
                                </li>
                            </ul>
                        </li>
                        <!-- END USER LOGIN DROPDOWN -->

                    </ul>
                    <!-- END TOP NAVIGATION MENU -->
                </div>
            </c:if>
            <!-- END TOP BAR MENU -->
        </div>
    </div>
</div>
<script>
    function logout() {
        location.href = basePath + "logout";
    }

    function toHome() {
        location.href = basePath;
    }
    function selfCenter(){
        location.href = basePath + "userCenter/getUserCenterPage";
    }
</script>